﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JQueryControlToolkit;
using UIT.Animations;

namespace UIT.Web.Renderers.Animations
{
    public interface IWebAnimationRenderer : IAnimationRenderer
    {
        string TargetValue { get; }
    }


    public interface IWebAnimationRenderer<T> : IAnimationRenderer<T>, IWebAnimationRenderer
        where T : IAnimation
    {
    }

    public abstract class WebAnimationRenderer<T> : IWebAnimationRenderer<T>
        where T : class, IAnimation
    {
        #region IWebAnimationRenderer<T> Members

        public string TargetValue
        {
            get;
            protected set;
        }

        #endregion

        #region IAnimationRenderer Members

        public void Render(UIT.Animations.IAnimation control)
        {
            Render(control as T);
        }

        #endregion

        #region IRenderer Members

        public RendererManager Manager
        {
            get;
            private set;
        }

        public void Initialize(RendererManager manager, object userObject)
        {
            Manager = manager;
        }

        #endregion

        #region IRenderer<T> Members

        public abstract void Render(T control);

        #endregion
    }
}
